<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Determines whether an object is equal to the current instance</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.ds-hashable.html">« Hashable</a></li>
      <li style="float: right;"><a href="ds-hashable.hash.html">Ds\Hashable::hash »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.ds-hashable.html">Hashable</a></li>
    <li>Determines whether an object is equal to the current instance</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="ds-hashable.equals" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Ds\Hashable::equals</h1>
  <p class="verinfo">(PECL ds &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Ds\Hashable::equals</span> &mdash; <span class="dc-title">Determines whether an object is equal to the current instance</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-ds-hashable.equals-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><strong>Ds\Hashable::equals</strong></span>(<span class="methodparam"><span class="type">object</span> <code class="parameter">$obj</code></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
    Determines whether another object is equal to the current instance.
  </p>

  <p class="para">
    This method allows objects to be used as keys in structures such as
    <span class="classname"><strong class="classname">Ds\Map</strong></span> and <span class="classname"><strong class="classname">Ds\Set</strong></span>, or any
    other lookup structure that honors this interface.
  </p>

  <blockquote class="note"><p><strong class="note">注意</strong>: 
    <p class="para">
        It&#039;s guaranteed that <code class="parameter">obj</code> is an instance of the same class.
    </p>
  </p></blockquote>

  <div class="caution"><strong class="caution">警告</strong>
    <p class="para">
        It&#039;s important that objects which are equal also have the same hash value.
        See <span class="function"><a href="ds-hashable.hash.html" class="function">Ds\Hashable::hash()</a></span>.
    </p>
  </div>

 </div>


 <div class="refsect1 parameters" id="refsect1-ds-hashable.equals-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">obj</code></dt>

    <dd>

     <p class="para">
        The object to compare the current instance to, which is always an instance of
        the same class.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-ds-hashable.equals-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
    <strong><code>true</code></strong> if equal, <strong><code>false</code></strong> otherwise.
  </p>
 </div>



</div></div></div></body></html>